cmake_minimum_required(VERSION 3.2)

project(cgalViewer
    LANGUAGES CXX C
    VERSION 0.0.1
)

if(CMAKE_CXX_STANDARD)
    if(CMAKE_CXX_STANDARD LESS 17)
        message(FALTER "Cpp standard was required not less 17.")
    endif()
else()
    set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

find_package(Qt6 REQUIRED COMPONENTS OpenGLWidgets OpenGL)
find_package(CGAL REQUIRED)
find_package(Boost REQUIRED COMPONENTS program_options)
find_package(Assimp REQUIRED)
find_package(tiff REQUIRED)
find_package(VTK REQUIRED)

add_executable(cgalViewer)
target_link_libraries(cgalViewer PRIVATE
    Qt6::OpenGL
    Qt6::OpenGLWidgets
    Qt6::Gui
    CGAL::CGAL
    Boost::program_options
    assimp::assimp
    ${VTK_LIBRARIES}
)
target_sources(cgalViewer PRIVATE
    src/main.cpp
    src/cgal_source_poly.cpp
    src/cgal_source_edge.cpp
    src/cgal_source_halfedge.cpp
    src/cgal_source_point.cpp
    src/gen_halfedge.cpp
)
vtk_module_autoinit(
    TARGETS cgalViewer
    MODULES ${VTK_LIBRARIES}
)
